package cn.com.blueInfo.bpm.person.enums;

import cn.com.blueInfo.bpm.common.enums.BaseEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 组成方式
 * @author suxch
 * @since 2025-08-28 22:06:38
 */
@Getter
@AllArgsConstructor
public enum GroupInfoFormula implements BaseEnum<Integer> {

    /** 组成方式-动态过滤 */
    DYNAMIC_FILTER(0, "动态过滤"),
    /** 组成方式-固定人员 */
    STATIC_USER(1, "固定人员");

    @EnumValue
    private final Integer code;

    @JsonValue
    private final String desc;

    public static GroupInfoFormula getByCode(Integer code) {
        return BaseEnum.getByCode(GroupInfoFormula.class, code);
    }

    @JsonCreator
    public static GroupInfoFormula getByName(String name) {
        return BaseEnum.getByName(name, GroupInfoFormula.class);
    }

}
